<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>销售退货单-{$mydata.mas_no}</title>
	<include file="Public:header" />
    <link rel="stylesheet" type="text/css" href="/Public/Css/print_style.css">
	<style type="text/css">
		.input{width:130px; border:1px solid #ccc; padding:2px;}
		.input0{border:0px; padding:0px; margin:0px; height:14px; overflow:hidden;}
		.input2{border:1px solid #ccc; padding:0px; margin:1px 0px 1px 0px; height:20px; display:inline-block;}
		.select{width:180px; border:1px solid #ccc; height:25px; padding:2px;}
        .font13{font-size:13px;}
        .font14{font-size:14px;}
	</style>
    <style media="print" type="text/css">
        .paging{page-break-after:always} 
    </style>
	<script type="text/javascript">		
		var actflg="{:C('URL_MODEL')}"=="0"?"&":"?";
		
		window.onload=function()
		{
			window.print();
		}
	</script>
</head>
<body class="">
<php>
$dataitem=$mydata_item;
$total_row=count($dataitem);
$page_index=1;
$print_pagesize=(int)C('PRINT_PAGESIZE')==''?'10000':C('PRINT_PAGESIZE');
$page_total=ceil($total_row/$print_pagesize);
$arr_index=0;
$for_index=0;
$v_amount1=0;
foreach($dataitem as $k=>$v)
{
    $v_amount1 += $v['amount1'];
    $for_index += 1;
    if($for_index%$print_pagesize===0 || $for_index==$total_row)
    {
        $arr_amount1[$arr_index]=$v_amount1;
        $v_amount1=0;
        $arr_index += 1;
    }
}
</php>
<table width="100%" border="0" cellspacing="0" cellpadding="5">
  <tr>
    <td width="25%">总计：-<php>echo get_round($arr_amount1[0]);</php></td>
    <td width="50%" align="center" style="font-size:18px;">{$web_title}销售退货清单</td>
    <td width="25%" align="right">单据编号：{$mydata.mas_no}</td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="5">
  <tr>
    <td width="60%">购货单位：{$mydata.customer_title}</td>
    <td align="right">开票时间：{$mydata.fadate|date='Y-m-d',###} &nbsp;&nbsp;&nbsp;&nbsp;第<php>echo $page_index;</php>页&nbsp;/&nbsp;共<php>echo $page_total;</php>页</td>
  </tr>
</table>
<table width="100%" border="1" cellspacing="0" cellpadding="2">
  <tr>
    <td align="center">货号</td>
    <td align="center">商品名称</td>
    <td align="center">规格</td>
    <td align="center">产地</td>
    <td align="center">单位</td>
    <td align="center">数量</td>
    <td align="center">单价</td>
    <td align="center">金额</td>
    <td align="center">批号/有效期</td>
    <td align="center">批准文号</td>
    <td align="center">质量</td>
  </tr>
    <php>$item_no=0;$item_pager=0;</php>
    <volist name="mydata_item" id="mydata_item" key="k">
  <tr>
    <td class="col_A">{$mydata_item.stk_code}</td>
    <td class="col_B font14">{$mydata_item.stk_title}</td>
    <td class="col_C">{$mydata_item.spec}</td>
    <td class="col_D">{$mydata_item.madein}</td>
    <td class="col_E" align="center">{$mydata_item.stk_uom}</td>
    <td class="col_F" align="center">-{$mydata_item.qty|get_round=###,2}</td>
    <td class="col_G" align="center">{$mydata_item.price|get_round=###,2}</td>
    <td class="col_H" align="center">-{$mydata_item.amount1|get_round=###,2}</td>
    <td class="col_I" align="center">{$mydata_item.batch_no}<br/>{$mydata_item.expiry_date|get_date='Ymd',###}</td>
    <td class="col_J" align="center">{$mydata_item.approval_no}</td>
    
    <td class="col_K" align="center">合格</td>
  </tr>
    <php>
    $item_no+=1;
    if($item_no%$print_pagesize===0 && $item_no<$total_row)
    {
        $item_pager+=1;  
        $page_index+=1;        
    </php>
<!-- bof print page -->
  <tr>
    <td colspan="5">本页金额(大写)：负<php>echo get_cny(get_round($arr_amount1[$item_pager-1]));</php></td>
    <td colspan="3">本页金额小计：-<php>echo get_round($arr_amount1[$item_pager-1]);</php></td>
    <td colspan="3" align="center">付款方式：口&nbsp;转账&nbsp;&nbsp;&nbsp;&nbsp;口&nbsp;现金</td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="5">
  <tr>
    <td width="25%">开票人：{$mydata.creater_username}</td>
    <td width="25%">复核人：{$mydata.poster_username}</td>
    <td width="25%">收款人：{$mydata.poster_username}</td>
    <td width="25%">提货人：{$mydata.manager_title}</td>
  </tr>
</table>

<div class="paging"></div>

<table width="100%" border="0" cellspacing="0" cellpadding="5">
  <tr>
    <td width="25%">总计：-<php>echo get_round($arr_amount1[$item_pager]);</php></td>
    <td width="50%" align="center" style="font-size:18px;">{$web_title}销售退货清单</td>
    <td width="25%" align="right">单据编号：{$mydata.mas_no}</td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="5">
  <tr>
    <td width="60%">购货单位：{$mydata.customer_title}</td>
    <td align="right">开票时间：{$mydata.fadate|date='Y-m-d',###} &nbsp;&nbsp;&nbsp;&nbsp;第<php>echo $page_index;</php>页&nbsp;/&nbsp;共<php>echo $page_total;</php>页</td>
  </tr>
</table>
<table width="100%" border="1" cellspacing="0" cellpadding="2">
  <tr>
    <td align="center">货号</td>
    <td align="center">商品名称</td>
    <td align="center">规格</td>
    <td align="center">产地</td>
    <td align="center">单位</td>
    <td align="center">数量</td>
    <td align="center">单价</td>
    <td align="center">金额</td>
    <td align="center">批号/有效期</td>
    <td align="center">批准文号</td>
    <td align="center">质量</td>
  </tr>
<!-- eof print page -->
    <php>}</php>
    </volist>
  <tr>
    <td colspan="5">本页金额(大写)：负<php>echo get_cny(get_round($arr_amount1[$page_index-1]));</php></td>
    <td colspan="3">本页金额小计：-<php>echo get_round($arr_amount1[$page_index-1]);</php></td>
    <td colspan="3" align="center">付款方式：口&nbsp;转账&nbsp;&nbsp;&nbsp;&nbsp;口&nbsp;现金</td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="5">
  <tr>
    <td width="25%">开票人：{$mydata.creater_username}</td>
    <td width="25%">复核人：{$mydata.poster_username}</td>
    <td width="25%">收款人：{$mydata.poster_username}</td>
    <td width="25%">提货人：{$mydata.manager_title}</td>
  </tr>
</table>

	
</body>
</html>
